package com.woniuxy.shop.Controller;

import com.hc.entity.Shop;
import com.woniuxy.shop.Entity.ResponseEntity;
import com.woniuxy.shop.Service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *@ClassName ShopController
 *@Description 通过商品的id返回店铺的信息
 *@Author TJ
 *@Date 2022/10/20 11:36
 *@Version 1.0
 **/
@RestController
@RequestMapping("goods")
public class GoodsController {
    @Autowired
    GoodsService goodsService;
    @GetMapping("/getByGoodsId/{id}")
    public ResponseEntity<Shop> getByGoodsId(@PathVariable(value = "id") int id){
        Shop shop = goodsService.getByGoodsId(id);
        return new ResponseEntity<>("200","ok",shop);
    }
}
 